package com.netpace.iem.umair.helper;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Calendar;
import java.util.GregorianCalendar;


public class Console {
    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    public static char readChar() {
        char c = 0;
        try {
            c = (char) br.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return c;
    }

    public static String readLine() {
        String s = null;
        try {
            s = (String) br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    public static long readLong() {
        long x = 0;
        try {
            x = Long.parseLong(br.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return x;
    }

    public static int readInt() {
        int x = 0;
        try {
            x = Integer.parseInt(br.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return x;
    }
    
    public static Calendar readDate() {
    	Calendar date;
    	String s="";
    	String[] d;
    	
            try {
				s = br.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
            d = s.split("-");
            date = new GregorianCalendar(Integer.parseInt(d[2]), 
            							Integer.parseInt(d[1]), 
            							Integer.parseInt(d[0]));

        return date;
    }
}
